package com.yang.booking.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yang.booking.pojo.Staff;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface StaffMapper extends BaseMapper<Staff> {

    @Select("select s.* from staff s left join staff_scheduling ss on s.id = ss.staff_id where ss.shift_management_id = #{shiftManagementId}")
    List<Staff> queryShiftStaff(String shiftManagementId);

    @Select("select s.* from staff s inner join staff_item si on s.id = si.staff_id where si.item_id = #{itemId} and s.app_situation = 1")
    List<Staff> queryItemStaff(String itemId);
}
